<template>
     <div>
      
    <div id="shop">
      <el-carousel :interval="2000" arrow="always" autoplay="true" height="400px">
    <el-carousel-item v-for="(v,i) in tableData" :key="i" >
      <h3><img :src="v.title" alt=""></h3>
    </el-carousel-item>
  </el-carousel>
    </div>
    <h3>美食展示</h3></div>
  </template>
  
  <script>
import { mendian } from '@/apis/zhaowenbo/zhaowenbo.js';

 export default {
  data(){
      return {
        tableData: [
        {title:'https://img0.baidu.com/it/u=2439198025,4191496025&fm=253&fmt=auto&app=138&f=JPEG?w=750&h=500'},
        {title:'https://img1.baidu.com/it/u=658022473,3534040419&fm=253&fmt=auto&app=120&f=JPEG?w=1280&h=800'},
        {title:'https://img2.baidu.com/it/u=3046498719,264578129&fm=253&fmt=auto&app=138&f=JPEG?w=781&h=500'},
        {title:'https://img2.baidu.com/it/u=1119797231,1724730465&fm=253&fmt=auto&app=138&f=JPEG?w=781&h=500'}
      ]
      }
    },
    mounted(){
      mendian().then((ok)=>{
        console.log(ok);
      })
    }
}

  </script>
  
  <style scoped>
  #shop{
 margin-top: 80px;
width:100%;
height: 400px;
line-height: 70px;
}
h3{
  width: 100%;
  text-align: center;
}
.el-carousel__item h3 {
    color: #475669;
    font-size: 18px;
    opacity: 0.75;
    line-height: 300px;
    margin: 0;
  }
  img{
    width: 100%;
    height:100%;
  }
  .el-carousel__item:nth-child(2n) {
    background-color: #99a9bf;
  }
  
  .el-carousel__item:nth-child(2n+1) {
    background-color: #d3dce6;
  }
  .el-carousel el-carousel--horizontal{
    margin-top: 200px;
  }
  </style>